﻿/*
 * Copyright (c) Jason Paul Morley, 2010
 * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Algorithms.Steps
{
    public class VisitNode : Core.IStep
    {
        public VisitNode(Core.Node a)
        {
            node = a;
        }

        private Core.State _pv_oldState;
        public void Apply()
        {
            _pv_oldState = node.state;
            node.state = Core.State.MaximumHighlighted;
        }

        public void ToNext()
        {
            node.state = _pv_oldState;
        }

        public void Undo()
        {
            _pv_oldState = node.state;
        }

        public string Name()
        {
            return "Select: " + node.id;
        }

        public Core.Node node;
    }
}
